package com.example.paopao.consumer.memer.controller;

import com.example.paopao.common.pojo.security.CurrenPrincipal;
import com.example.paopao.common.web.JsonResult;
import com.example.paopao.consumer.memer.pojo.dto.IntegraRacheDTO;
import com.example.paopao.consumer.memer.pojo.vo.IntegraRacheVO;
import com.example.paopao.consumer.memer.service.IIntegraRacheService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@RequestMapping("/v1/integra/")
@Api(tags = "10.订单生成")
public class IntegralRachargeController {

    @Autowired
    private IIntegraRacheService service;


    @PostMapping("rache")
    @ApiOperation("订单生成")
    public JsonResult integraRache(@RequestBody IntegraRacheDTO integraRacheDTO,@ApiIgnore @AuthenticationPrincipal CurrenPrincipal principal){
        IntegraRacheVO integraRacheVO = service.resultIntegralR(integraRacheDTO, principal);
        return JsonResult.ok(integraRacheVO);
    }
}
